package com.okaixz.client.controller;


import com.okaixz.client.model.dto.CsjJiliParams;
import com.okaixz.client.model.dto.UserDto;
import com.okaixz.client.model.vo.GetJiliListResult;
import com.okaixz.client.service.ICsjJiliOrderService;
import com.okaixz.common.client.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cdz
 * @since 2025-08-11
 */
@RestController
@RequestMapping("/kb/csj")
public class CsjJiliOrderController {
    @Autowired
    private ICsjJiliOrderService csjJiliOrderService;
    @GetMapping("/jiliCallback")
    public String csjJiLi(CsjJiliParams params) {
        return csjJiliOrderService.processJiliCallback(params);
    }
    @PostMapping("/jiliReward")
    public Result<UserDto> jiliReward(CsjJiliParams params) {
        UserDto userDto=csjJiliOrderService.jiliReward(params);
        return Result.success(userDto);
    }
    @PostMapping("/jiliOrder/list")
    public Result<GetJiliListResult> jiliOrderList(@RequestParam(required = true) String userId, @RequestParam(required = true)Integer type) {
        //type 0:全部订单 1:今天订单
        GetJiliListResult data=csjJiliOrderService.jiliOrderList(userId,type);
        return Result.success(data);
    }

}
